package com.mayblackcat.dy.service.impl;

import com.mayblackcat.dy.dao.RecommendDao;
import com.mayblackcat.dy.entity.Recommend;
import com.mayblackcat.dy.entity.Video;
import com.mayblackcat.dy.service.RecommendService;
import com.mayblackcat.dy.utils.CoreRecommend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName : RecommendServiceImpl
 * @Description :
 * @Author : MayBlackCat
 * @Date: 2021-08-09 15:55
 */

@Service
public class RecommendServiceImpl implements RecommendService {

    @Autowired
    private  RecommendDao recommendDao;

    @Override
    public  List<Recommend> findAll() {
        return recommendDao.findAll();
    }



    public List<Video> recommendVideo(Integer userId){
        //取出评分表
        List<Recommend> recommendTable=findAll();

        //调用协同过滤推荐算法
        CoreRecommend coreRecommend=new CoreRecommend();
        coreRecommend.recommend(userId,recommendTable);
        return new ArrayList<Video>();
    }


}
